<template>
    <div class="home-nav">
        <div class="login-top">
            <div v-if="$store.state.userMsg == null||''?true:false" class="login-top-before">
                <div>
                    <span class="fa fa-user" style="font-size:20px;margin-right:10px;"></span>
                    <span @click="$router.push({name:'login'})">{{$t('sideMenu.loginAndLogOut')}}</span>
                </div>
                <img src="../../assets/img/tixingw.png" alt />
            </div>
            <div v-else class="login-top-after">
                <div class="login-top-after-user">
                    <div>
                        <label for="pic">
                            <span>
                                <img src="../../assets/img/banner.png" alt />
                            </span>
                        </label>
                        <div>
                            <p class="singleSee" style="width:50%">UID:{{user.uuid}}</p>
                            <p>{{$t('sideMenu.totalAssets')}}:0.00000000 USDT</p>
                        </div>
                    </div>
                    <img src="../../assets/img/tixingw.png" alt />
                </div>
                <div class="login-top-after-money">
                    <div>
                        <p>
                            <img src="../../assets/img/shouyi.png" alt />
                            <span>{{$t('sideMenu.rentIncome')}}</span>
                        </p>
                        <p>0.00000000 USDT</p>
                    </div>
                    <img src="../../assets/img/tuoyuan.png" alt />
                </div>
            </div>
        </div>
        <div class="login-center">
            <div @click="$router.push({name:'fastSelect',query:{accountType:'getMoney'}})">
                <img src="../../assets/img/chongbi.png" alt />
                <p>{{$t('sideMenu.recharge')}}</p>
            </div>
            <div @click="$router.push({name:'fastSelect',query:{accountType:'outMoney'}})">
                <img src="../../assets/img/tibi.png" alt />
                <p>{{$t('sideMenu.Withdraw')}}</p>
            </div>
        </div>
        <div class="login-list">
            <div class="login-list-detail">
                <div @click="$router.push({name:'collect'})">
                    <img src="../../assets/img/myshoucang.png" alt />
                    <span>{{$t('sideMenu.collection')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <!-- 我的活动 -->
            <div class="login-list-detail">
                <div @click="$router.push({name:'activity'})">
                    <img src="../../assets/img/dingdan.png" alt />
                    <span>{{$t('sideMenu.activity')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'orderManagement'})">
                    <img src="../../assets/img/dingdan.png" alt />
                    <span>{{$t('sideMenu.OrderManagement')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'houseEarning'})">
                    <img src="../../assets/img/zufangshouyi.png" alt />
                    <span>{{$t('sideMenu.rentIncome')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'account',query:{accountType:'house'}})">
                    <img src="../../assets/img/fangchan.png" alt />
                    <span>{{$t('sideMenu.housingAccount')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'account',query:{accountType:'faBin'}})">
                    <img src="../../assets/img/fabi.png" alt />
                    <span>{{$t('sideMenu.FiatAccount')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'rebate'})">
                    <img src="../../assets/img/yaoqing.png" alt />
                    <span>{{$t('sideMenu.InviteCommission')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'safetyCenter'})">
                    <img src="../../assets/img/anquanzhongxin.png" alt />
                    <span>{{$t('sideMenu.securityCenter')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <div class="login-list-detail">
                <div @click="$router.push({name:'setting'})">
                    <img src="../../assets/img/shezhi.png" alt />
                    <span>{{$t('sideMenu.set')}}</span>
                </div>
                <img src="../../assets/img/more-tongzhi.png" alt />
            </div>
            <input @change="uploadPic" style="width:0;height:0" type="file" name="pic" id="pic" />
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            loginState: false
        };
    },
    computed: {
        user() {
            return JSON.parse(this.$store.state.userMsg);
        }
    },
    methods: {
        uploadPic() {
            var pic = new FormData();
            pic.append("file", $('#pic')[0].files[0]);
            console.log(pic)
            this.$axios.post(this.address.singlePic,pic,{
                withCredentials:false
            }).then(res => {
                console.log(res.data)
            })
        }
    }
};
</script>
<style lang="less" scoped>
.home-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 75%;
    height: 100%;
    background-color: @white;
    z-index: 3;
    .login-top {
        height: 28vh;
        background-color: @blueColor5;
        .login-top-before {
            .flexBetweenCenter();
            padding: 70px 15px 0;
            div:nth-child(1) {
                .flexBetweenCenter();
                font-size: 18px;
                color: @white;
                font-weight: bold;
                span:nth-child(1) {
                    border: 2px solid @white;
                    border-radius: 50%;
                    display: inline-block;
                    width: 45px;
                    height: 45px;
                    text-align: center;
                    line-height: 45px;
                }
            }
            > img:nth-child(2) {
                width: 20px;
            }
        }
        .login-top-after {
            height: 100%;
            position: relative;
            .login-top-after-user {
                padding: 50px 15px 0;
                .flexBetweenCenter();
                div:nth-child(1) {
                    .flexStart();
                    span:nth-child(1) {
                        width: 38px;
                        height: 38px;
                        border-radius: 50%;
                        overflow: hidden;
                        .flexCenterContent();
                        margin-right: 10px;
                    }
                    div:nth-child(2) {
                        font-size: 18px;
                        color: @white;
                        p:first-child {
                            font-size: 18px;
                            color: @white;
                        }
                        p:nth-child(2) {
                            font-size: 12px;
                            color: @white;
                        }
                    }
                }
                img:nth-child(2) {
                    width: 20px;
                }
            }
            .login-top-after-money {
                width: 70%;
                height: 74px;
                padding-left: 20px;
                background-color: rgba(0, 0, 0, 0.08);
                position: absolute;
                left: 0;
                bottom: 0;
                border-radius: 0 15px 15px 0;
                .flexBetweenCenter();
                div:nth-child(1) {
                    p:nth-child(1) {
                        font-size: 12px;
                        color: @white;
                        img {
                            width: 11px;
                        }
                    }
                    p:nth-child(2) {
                        font-size: 16px;
                        color: @white;
                        margin-top: 6px;
                    }
                }
                img:nth-child(2) {
                    width: 20px;
                }
            }
        }
    }
    .login-center {
        .flexAroundCenter();
        height: 10vh;
        border-bottom: 1px solid @blackColor3;
        div {
            img {
                width: 18px;
                display: block;
                margin: 0 auto 10px;
            }
            p {
                font-size: 14px;
                color: @blueColor10;
            }
        }
    }
    .login-list {
        padding: 20px 15px;
        height: 62vh;
        .login-list-detail {
            .flexBetweenCenter();
            height: 6vh;
            div:nth-child(1) {
                .flexStartCenter();
                color: @blueColor10;
                font-size: 14px;
                img {
                    width: 15px;
                    margin-right: 20px;
                }
            }
            img:nth-child(2) {
                width: 5px;
            }
        }
    }
}
</style>
